## Classes and Methods for R developed in the
## Political Science Computational Laboratory
## Department of Political Science
## Stanford University
## Simon Jackman
## hurdle and zeroinfl functions by Achim Zeileis
## [1] "initializing data.frame (2nt) ..."
##    user  system elapsed 
##  18.120   1.259  26.473
## [1] "counting footprints (2nt) ..."
##    user  system elapsed 
##   0.625   1.135  52.480
## [1] "initializing data.frame (3nt) ..."
##    user  system elapsed 
##  18.782   1.297  27.078
## [1] "counting footprints (3nt) ..."
##    user  system elapsed 
##   0.523   0.849  48.063

regression models

plot fits

evaluate model fits

fit deviance AIC dispersion total_error
poisson (2nt) 3869944.6 3939067.4 1.00000 3915786
quasipois (2nt) 3869944.6 NA 262.72503 3915786
negbin (2nt) 13960.9 134116.0 1.00000 4537915
poisson (3nt) 914188.5 983501.3 1.00000 1532132
quasipois (3nt) 914188.5 NA 49.05492 1532132
negbin (3nt) 13448.1 124122.4 1.00000 1661988

## [1] "testing... poisson vs. negative binomial regression (2nt)"
## Likelihood ratio test of H0: Poisson, as restricted NB model:
## n.b., the distribution of the test-statistic under H0 is non-standard
## e.g., see help(odTest) for details/references
## 
## Critical value of test statistic at the alpha= 0.05 level: 2.7055 
## Chi-Square Test Statistic =  3804953.4501 p-value = < 2.2e-16
## [1] "testing... poisson vs. negative binomial regression (3nt)"
## Likelihood ratio test of H0: Poisson, as restricted NB model:
## n.b., the distribution of the test-statistic under H0 is non-standard
## e.g., see help(odTest) for details/references
## 
## Critical value of test statistic at the alpha= 0.05 level: 2.7055 
## Chi-Square Test Statistic =  859380.9567 p-value = < 2.2e-16

violin plots of model residuals

mean-variance plots for residuals

residual distributions, by predictors

compare A site regression coefficients to simulation parameters

plot all codon parameters

compare bias sequence regression coefficients to simulation parameters

## [1] "poisson : TAA,TAG,TGA"
## [1] "quasipois : TAA,TAG,TGA"
## [1] "negbin : TAA,TAG,TGA"

bias correction

  1. set all 5’ and 3’ bias sequences to the reference level (AAA)

  2. predict footprint counts with modified data

  3. codon correlation plots to evaluate bias correction

    • collapse to counts per codon

    • scale footprint counts: divide raw counts by average across transcript

    • full model: -7 to +5 codons; plus 13 leave-one-out models

    • compute Pearson correlations btwn true & predicted scaled counts